package com.fm.base.domain.region;

import com.fm.base.database.DBDocument;
import com.fm.base.factory.ClassFactory;

public class ChineseRegion implements Region {
	public String province;
	public String city;
	public String county;

	@Override
	public void decode(DBDocument document) {
		province = document.getString("province");
		city = document.getString("city");
		county = document.getString("county");
	}

	@Override
	public DBDocument encode(ClassFactory<DBDocument> factory) {
		DBDocument doc = factory.create();
		doc.put("province", province);
		doc.put("city", city);
		doc.put("county", county);
		return doc;
	}
}
